'use strict';
const db = uniCloud.database()

exports.delete1 = async (data) => {
  const collection = db.collection('imagesBase');

  // let article = await collection.where({
  let res = await collection.where({
    name: data.name
  }).remove() // 切记获取最后一定要 get()

  if (res.affectedDocs == 1) {

    return {
      code: global.successCode,
      msg: '删除成功'
    }
  } else {
    return {
      code: global.wrongCode,
      msg: '删除失败'
    }
  }

}
